/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package arbre;


import fileNoeud.FilePrioriteeDeNoeud;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author ksz
 */
public class testArbreHuffman {

    public testArbreHuffman() {
    }

    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
    @Test
    public void testCreationArbreEtTaille() {
        ArbreHuffman arbre = new ArbreHuffman();
        FilePrioriteeDeNoeud filePrioritee = new FilePrioriteeDeNoeud();

        Element elem = new Element<Character>('h', 1);
        filePrioritee.insererPrioritee(new NoeudFeuille(elem));
        elem = new Element<Character>('e', 1);
        filePrioritee.insererPrioritee(new NoeudFeuille(elem));
        elem = new Element<Character>('l', 2);
        filePrioritee.insererPrioritee(new NoeudFeuille(elem));
        elem = new Element<Character>('o', 1);
        filePrioritee.insererPrioritee(new NoeudFeuille(elem));

        arbre.construireArbre(filePrioritee);

        arbre.afficherBitsCode();

        assertTrue(arbre.getRacine().getPrioritee() == 5);
    }

}